package cn.goktech.edu.test;

import cn.goktech.util.ResultUtil;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.*;

/**
 * 临时登录
 */
@RestController
@RequestMapping("/edu/admin")
@Api(description = "临时登录操作")
@CrossOrigin //解决跨域问题
public class DemoLogin {

    @ApiOperation("登录逻辑")
    @CrossOrigin
    @PostMapping("/user/login")
    public ResultUtil Login(){
        return ResultUtil.ok().data("token","admin");
    }

    @CrossOrigin
    @GetMapping("user/info")
    @ApiOperation("获取用户信息")
    public ResultUtil getInfo(){
        String reslut = "{'roles':1,'name':'carter','avatar':'https://www.baidu.com/link?url=1DyNrbjVg81omB-gxqOeK4xebLZOCO3-uSRl8K97Zdjv9jHV0ZM0PjeRs4Ndmg5-Q_K43QrVpv4iYVgeWo7iy1QhoXGUqGN0JWRPrP82XQ1cwQxXY-Uan9nlAwwPcj0wwmefCMRXk5pk6D76irofTfJ70fdGcSDV1M-iUdKKsi3uYpBfinTAZIJukg0QGsVvFnk8TKlA4Ii9ns0EbA6ezPSTBRapV_xsT0Q2LZt4lAKHsZinrIO6Fl6_CDqdOxWEWf1bEd9iIH_-i3GjN2crO478kAlyY2NwYB5oYhCv-dOQITMOPWfWWPEINmDGtupI1kMXzxTZpqTPMXBZkRwIuwwtiBbI9uFZtnJdCU_9qKTXJdTkWu17h3nfw2OF8xUPE-y778jWdkldJi2LxrrYBrQkSU1VVA6qMy7yA-Zk_O1CnP3uoM4XbjL0mbq8ySH71PzjY4pFhAmBNK-4abpzj_vZZ4W5VE44WE-1BRbNe07QCOrJ33uKt5VTzudJn1J5S5wnfP1K2zvJe_jlvWpqkcySHs90mPE4po5VvxLlqIU4yaqk-_2av0S5IE_XZzxnRiWfQ4lsJzF9Ymurs_PQLjsZyeT7C-dbZ_VPH35Mopi&click_t=1612234709175&s_info=1263_578&wd=&eqid=e319e95c0000d0cb000000066018bfad'}";
        return ResultUtil.ok().data("roles","1").data("name","carter").data("avatar","https://ss3.bdstatic.com/70cFv8Sh_Q1YnxGkpoWK1HF6hhy/it/u=3207054189,273296922&fm=26&gp=0.jpg");

    }

}
